// JavaScript Document
districtprofile = jQuery.noConflict();
districtprofile().ready(function() {
					
	districtprofile("#profile-district-node-form").validate({
													  


// Title Validation
  rules: {
	  'field_dis_name[und]':{
		  valuenotequals:'_none',
	  },
	  'field_dis_area[und][0][value]':{
		  required:true,
		  badchar:true,
	  },
	  'field_dis_population[und][0][value]':{
		  required:true,
		  badchar:true,
	  },
	  'title':{
		  required:true,
		  badchar:true,
	  },
	  'field_dis_history[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_peopleculture[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_languages[und][0][value]':{
		  required:true,
		  badchar:true,
	  },
	  'field_dist_url[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_administrativesetup[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_education[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_health[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_agriculture[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_irrigation[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_industry[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_transport[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_communication[und][0][value]':{
		  badchar:true,
	  },
	  'field_dis_touristplaces[und][0][value]':{
		  badchar:true,
	  },
  },
  messages: {
	'field_dis_name[und]':{
		valuenotequals:' Please Choose the district',
	 },
	 'field_dis_area[und][0][value]':{
		 required:' Please enter the Area (Sq.Km)',
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_population[und][0][value]':{
		 required:' Please enter the Population',
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'title':{
		 required:' Please enter the District Head quarters',
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_history[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_peopleculture[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_languages[und][0][value]':{
		 required:' Please enter the Languages Spoken',
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dist_url[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_administrativesetup[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_education[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_health[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_agriculture[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_irrigation[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_industry[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_transport[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_communication[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
	 'field_dis_touristplaces[und][0][value]':{
		 badchar:'Special Characters and insert, select, update, delete, drop, alter, change, modify words are not allowed' ,
	 },
  },
  errorLabelContainer: "#errormsg_container",
  invalidHandler: function(form, validator) {
       
       					 if (!validator.numberOfInvalids())
								return;
						else{
							
							  //district("#documents-node-form").create_errormsg_container('errormsg_container','documents-node-form');
						}
							
       					districtprofile('html, body').animate({
								scrollTop: districtprofile(validator.errorList[0].element).offset().top - 100
							}, 1000);
							
						},
				

   
	});

});		